<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ai Studio</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>


<div id="app">
    <h1>普通文本识别!</h1>
    <el-upload
            class="upload-demo"
            action="/pic"
            :on-success="handlePicSuccess">
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
    <el-input
            type="textarea"
            :rows="5"
            placeholder="请输入内容"
            v-model="words">
    </el-input>
    <h1>图像识别</h1>
    <el-upload
            class="upload-demo"
            action="/img"
            :on-success="handleImgSuccess">
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
    <el-input
            type="textarea"
            :rows="5"
            placeholder="请输入内容"
            v-model="imgRecognition">
    </el-input>
    <h1>票据识别!</h1>
    <el-upload
            class="upload-demo"
            action="/pic"
            :on-success="handleAvatarSuccess">
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
    <el-input
            type="textarea"
            :rows="5"
            placeholder="请输入内容"
            v-model="words">
    </el-input>
    <h1>语音识别!</h1>
    <el-upload
            class="upload-demo"
            action="/pic"
            :on-success="handleAvatarSuccess">
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
    <el-input
            type="textarea"
            :rows="5"
            placeholder="请输入内容"
            v-model="words">
    </el-input>
</div>

</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            words:'',
            imgRecognition:''
        },
        methods: {
            handlePicSuccess(res, file) {
                console.log(res);
                console.log(file);
                this.words = res;
            },
            handleImgSuccess(res, file) {
                console.log(res);
                // console.log(file);
                this.imgRecognition = res[0];
            },
        }
    })
</script>

</html>